package vn.candyapp.qlct.database.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ThongKeDS implements Serializable {

	private static final long serialVersionUID = 1L;

	private String name;
	private List<ThongKeItem> categories = new ArrayList<ThongKeItem>();
	private float total = 0;
	
	public ThongKeDS(String name) {
		setName(name);
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public List<ThongKeItem> getCategories() {
		return categories;
	}

	public void setCategories(List<ThongKeItem> categories) {
		this.categories = categories;
	}
	
	public void addCategoryItem(ThongKeItem item) {
		categories.add(item);
		setTotal(getTotal() + item.getAmount());
	}

	public float getTotal() {
		return total;
	}

	public void setTotal(float total) {
		this.total = total;
	}
	
}
